<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关于我 - TechBlog</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            /* 亮色主题变量 */
            --bg-color: #ffffff;
            --text-color: #24292f;
            --border-color: #d0d7de;
            --card-bg: #f6f8fa;
            --header-bg: #f6f8fa;
            --accent-color: #0969da;
            --accent-hover: #0550ae;
            --code-bg: rgba(175, 184, 193, 0.2);
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
            --tag-bg: #ddf4ff;
            --tag-color: #0969da;
            --filter-bg: #f6f8fa;
            --input-bg: #ffffff;
            --timeline-color: #0969da;
            --skill-bar-bg: #e1e4e8;
        }

        .dark-theme {
            /* 深色主题变量 */
            --bg-color: #0d1117;
            --text-color: #e6edf3;
            --border-color: #30363d;
            --card-bg: #161b22;
            --header-bg: #161b22;
            --accent-color: #2f81f7;
            --accent-hover: #1c6bdb;
            --code-bg: rgba(110, 118, 129, 0.4);
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.7);
            --tag-bg: #388bfd26;
            --tag-color: #58a6ff;
            --filter-bg: #161b22;
            --input-bg: #0d1117;
            --timeline-color: #2f81f7;
            --skill-bar-bg: #21262d;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.5;
        }

        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 头部导航 */
        header {
            background-color: var(--header-bg);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
            position: relative;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 600;
            font-size: 20px;
            color: var(--text-color);
            text-decoration: none;
            z-index: 101;
        }

        .logo i {
            color: var(--accent-color);
        }

        .nav-links {
            display: flex;
            gap: 24px;
        }

        .nav-links a {
            color: var(--text-color);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .nav-links a:hover {
            color: var(--accent-color);
        }

        .nav-links a.active {
            color: var(--accent-color);
            font-weight: 600;
        }

        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .theme-toggle {
            background: none;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 8px 12px;
            color: var(--text-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            transition: all 0.2s ease;
        }

        .theme-toggle:hover {
            background-color: var(--code-bg);
        }

        .mobile-menu {
            display: none;
            background: none;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-color);
            cursor: pointer;
            padding: 8px 12px;
            font-size: 16px;
            transition: all 0.2s ease;
        }

        .mobile-menu:hover {
            background-color: var(--code-bg);
        }

        /* 主要内容区域 */
        .main-content {
            display: flex;
            flex-direction: column;
            gap: 32px;
            padding: 32px 0;
        }

        /* 标题区域 */
        .section-header {
            margin-bottom: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
        }

        .section-header h2 {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 0;
        }

        /* 内容容器 */
        .content-container {
            display: flex;
            gap: 32px;
            align-items: flex-start;
        }

        /* 关于我主要内容区域 */
        .about-section {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        /* 个人简介卡片 */
        .profile-card {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 32px;
            display: flex;
            gap: 24px;
            align-items: flex-start;
        }

        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 3px solid var(--border-color);
            flex-shrink: 0;
        }

        .profile-info {
            flex: 1;
        }

        .profile-name {
            font-size: 28px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .profile-title {
            font-size: 18px;
            color: var(--accent-color);
            margin-bottom: 12px;
        }

        .profile-bio {
            margin-bottom: 16px;
            line-height: 1.6;
        }

        .profile-stats {
            display: flex;
            gap: 24px;
            margin-bottom: 16px;
        }

        .stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .stat-value {
            font-size: 24px;
            font-weight: 600;
            color: var(--accent-color);
        }

        .stat-label {
            font-size: 14px;
            opacity: 0.8;
        }

        .profile-links {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .profile-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            background-color: var(--accent-color);
            color: white;
            text-decoration: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .profile-link:hover {
            background-color: var(--accent-hover);
            transform: translateY(-1px);
        }

        .profile-link.secondary {
            background-color: var(--code-bg);
            color: var(--text-color);
        }

        .profile-link.secondary:hover {
            background-color: var(--border-color);
        }

        /* 技能卡片 */
        .skills-card {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 24px;
        }

        .skills-card h3 {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-color);
        }

        .skill-category {
            margin-bottom: 24px;
        }

        .skill-category h4 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--accent-color);
        }

        .skill-item {
            margin-bottom: 12px;
        }

        .skill-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        .skill-name {
            font-size: 14px;
            font-weight: 500;
        }

        .skill-level {
            font-size: 12px;
            opacity: 0.8;
        }

        .skill-bar {
            height: 8px;
            background-color: var(--skill-bar-bg);
            border-radius: 4px;
            overflow: hidden;
        }

        .skill-progress {
            height: 100%;
            background-color: var(--accent-color);
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        /* 时间线卡片 */
        .timeline-card {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 24px;
        }

        .timeline-card h3 {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-color);
        }

        .timeline {
            position: relative;
            padding-left: 30px;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 2px;
            background-color: var(--timeline-color);
        }

        .timeline-item {
            position: relative;
            margin-bottom: 24px;
        }

        .timeline-item:last-child {
            margin-bottom: 0;
        }

        .timeline-item::before {
            content: '';
            position: absolute;
            left: -36px;
            top: 4px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background-color: var(--timeline-color);
            border: 2px solid var(--bg-color);
        }

        .timeline-date {
            font-size: 14px;
            color: var(--accent-color);
            margin-bottom: 4px;
            font-weight: 500;
        }

        .timeline-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .timeline-subtitle {
            font-size: 14px;
            opacity: 0.8;
            margin-bottom: 8px;
        }

        .timeline-description {
            font-size: 14px;
            line-height: 1.5;
        }

        /* 侧边栏 */
        .sidebar {
            width: 300px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        /* 侧边栏区块 */
        .sidebar-section {
            background-color: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 16px;
        }

        .sidebar-section h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }

        .about-me {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin-bottom: 12px;
            border: 2px solid var(--border-color);
        }

        .social-links {
            display: flex;
            gap: 12px;
            margin-top: 12px;
        }

        .social-links a {
            color: var(--text-color);
            font-size: 18px;
            transition: color 0.2s ease;
        }

        .social-links a:hover {
            color: var(--accent-color);
        }

        .categories-list,
        .tags-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .categories-list a,
        .tags-list a {
            background-color: var(--code-bg);
            color: var(--text-color);
            padding: 4px 8px;
            border-radius: 6px;
            text-decoration: none;
            font-size: 12px;
            transition: all 0.2s ease;
        }

        .categories-list a:hover,
        .tags-list a:hover {
            background-color: var(--accent-color);
            color: white;
        }

        /* 页脚 */
        footer {
            border-top: 1px solid var(--border-color);
            padding: 32px 0;
            text-align: center;
            font-size: 14px;
            color: var(--text-color);
            opacity: 0.8;
        }

        /* 响应式设计优化 */
        @media (max-width: 1024px) {
            .content-container {
                gap: 24px;
            }

            .sidebar {
                width: 250px;
            }
        }

        @media (max-width: 900px) {
            .content-container {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                order: -1;
                margin-bottom: 0;
            }

            .sidebar-section {
                padding: 20px;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 0 16px;
            }

            .navbar {
                padding: 12px 0;
            }

            .logo {
                font-size: 18px;
            }

            .nav-links {
                position: absolute;
                top: 100%;
                left: 0;
                width: 100%;
                background-color: var(--header-bg);
                border-top: 1px solid var(--border-color);
                flex-direction: column;
                padding: 16px 20px;
                display: none;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }

            .nav-links.active {
                display: flex;
            }

            .nav-links a {
                padding: 12px 0;
                border-bottom: 1px solid var(--border-color);
                font-size: 16px;
            }

            .nav-links a:last-child {
                border-bottom: none;
            }

            .mobile-menu {
                display: block;
                min-height: 44px;
                min-width: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .theme-toggle,
            .mobile-menu {
                padding: 10px 14px;
            }

            .main-content {
                padding: 24px 0;
                gap: 20px;
            }

            .content-container {
                gap: 20px;
            }

            .section-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .section-header h2 {
                font-size: 20px;
            }

            .profile-card {
                flex-direction: column;
                text-align: center;
                padding: 24px;
            }

            .profile-avatar {
                align-self: center;
                width: 100px;
                height: 100px;
            }

            .profile-stats {
                justify-content: center;
            }

            .profile-links {
                justify-content: center;
            }

            .skills-card,
            .timeline-card {
                padding: 20px;
            }

            .sidebar-section {
                padding: 16px;
            }

            .avatar {
                width: 60px;
                height: 60px;
            }

            /* 减少移动端的动画效果 */
            * {
                transition: none;
            }

            /* 保留必要的过渡 */
            .theme-toggle,
            .mobile-menu,
            .nav-links a,
            .profile-link {
                transition: all 0.2s ease;
            }
        }

        @media (max-width: 480px) {
            .profile-stats {
                flex-direction: column;
                gap: 12px;
            }

            .profile-links {
                flex-direction: column;
                align-items: center;
            }

            .profile-link {
                width: 100%;
                justify-content: center;
            }

            .container {
                padding: 0 12px;
            }

            .content-container {
                gap: 16px;
            }
        }

        @media (max-height: 500px) and (orientation: landscape) {
            .navbar {
                padding: 8px 0;
            }

            .main-content {
                padding: 16px 0;
            }
        }
    </style>
</head>

<body class="light-theme">
    <header>
        <div class="container">
            <nav class="navbar">
                <a href="index.html" class="logo">
                    <i class="fas fa-code"></i>
                    TechBlog
                </a>

                <div class="nav-links">
                    <a href="index.html">首页</a>
                    <a href="article-list.html">文章</a>
                    <a href="tutorial-list.html">教程</a>
                    <a href="projects.html">项目</a>
                    <a href="about.html" class="active">关于</a>
                </div>

                <div class="nav-actions">
                    <button class="theme-toggle" id="themeToggle">
                        <i class="fas fa-moon"></i>
                        <span>深色模式</span>
                    </button>
                    <button class="mobile-menu" id="mobileMenu">
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </nav>
        </div>
    </header>

    <div class="container">
        <div class="main-content">
            <!-- 标题区域 -->
            <div class="section-header">
                <h2>关于我</h2>
            </div>

            <!-- 侧边栏和主要内容放在同一个flex容器中 -->
            <div class="content-container">
                <main class="about-section">
                    <!-- 个人简介卡片 -->
                    <section class="profile-card">
                        <img src="https://avatars.githubusercontent.com/u/583231?v=4" alt="个人头像" class="profile-avatar">
                        <div class="profile-info">
                            <h1 class="profile-name">张明</h1>
                            <div class="profile-title">全栈开发者 & 技术博主</div>
                            <p class="profile-bio">
                                我是一名热爱技术的全栈开发者，专注于现代Web技术栈。拥有8年软件开发经验，擅长React、Node.js和云原生技术。
                                热爱开源，是多个知名开源项目的贡献者。喜欢通过博客分享技术见解和实践经验，帮助开发者社区成长。
                            </p>
                            <div class="profile-stats">
                                <div class="stat-item">
                                    <span class="stat-value">8年</span>
                                    <span class="stat-label">开发经验</span>
                                </div>
                                <div class="stat-item">
                                    <span class="stat-value">50+</span>
                                    <span class="stat-label">项目完成</span>
                                </div>
                                <div class="stat-item">
                                    <span class="stat-value">120+</span>
                                    <span class="stat-label">技术文章</span>
                                </div>
                            </div>
                            <div class="profile-links">
                                <a href="#" class="profile-link">
                                    <i class="fas fa-download"></i> 下载简历
                                </a>
                                <a href="#" class="profile-link secondary">
                                    <i class="fas fa-envelope"></i> 联系我
                                </a>
                                <a href="#" class="profile-link secondary">
                                    <i class="fab fa-github"></i> GitHub
                                </a>
                            </div>
                        </div>
                    </section>

                    <!-- 技能卡片 -->
                    <section class="skills-card">
                        <h3>技能专长</h3>
                        <div class="skill-category">
                            <h4>前端技术</h4>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">React</span>
                                    <span class="skill-level">专家</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 95%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">Vue.js</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 80%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">TypeScript</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 85%"></div>
                                </div>
                            </div>
                        </div>

                        <div class="skill-category">
                            <h4>后端技术</h4>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">Node.js</span>
                                    <span class="skill-level">专家</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 90%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">Python</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 75%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">数据库设计</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 80%"></div>
                                </div>
                            </div>
                        </div>

                        <div class="skill-category">
                            <h4>其他技能</h4>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">Docker & Kubernetes</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 70%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">UI/UX设计</span>
                                    <span class="skill-level">基础</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 60%"></div>
                                </div>
                            </div>
                            <div class="skill-item">
                                <div class="skill-header">
                                    <span class="skill-name">项目管理</span>
                                    <span class="skill-level">熟练</span>
                                </div>
                                <div class="skill-bar">
                                    <div class="skill-progress" style="width: 75%"></div>
                                </div>
                            </div>
                        </div>
                    </section>

                    <!-- 工作经历时间线 -->
                    <section class="timeline-card">
                        <h3>工作经历</h3>
                        <div class="timeline">
                            <div class="timeline-item">
                                <div class="timeline-date">2021年至今</div>
                                <h4 class="timeline-title">高级全栈工程师</h4>
                                <div class="timeline-subtitle">科技先锋公司 · 远程</div>
                                <p class="timeline-description">
                                    负责核心产品的前后端架构设计与开发，主导技术选型与团队代码规范制定。
                                    使用React + TypeScript + Node.js技术栈，优化应用性能，提升用户体验。
                                </p>
                            </div>
                            <div class="timeline-item">
                                <div class="timeline-date">2018-2021年</div>
                                <h4 class="timeline-title">前端技术主管</h4>
                                <div class="timeline-subtitle">创新科技 · 上海</div>
                                <p class="timeline-description">
                                    领导10人前端团队，负责多个大型项目的技术架构和开发工作。
                                    引入微前端架构，提升团队开发效率和项目可维护性。
                                </p>
                            </div>
                            <div class="timeline-item">
                                <div class="timeline-date">2015-2018年</div>
                                <h4 class="timeline-title">全栈开发者</h4>
                                <div class="timeline-subtitle">数字解决方案公司 · 北京</div>
                                <p class="timeline-description">
                                    参与多个企业级Web应用开发，从需求分析到部署上线的全流程工作。
                                    积累了丰富的项目实战经验和技术问题解决能力。
                                </p>
                            </div>
                        </div>
                    </section>

                    <!-- 教育背景时间线 -->
                    <section class="timeline-card">
                        <h3>教育背景</h3>
                        <div class="timeline">
                            <div class="timeline-item">
                                <div class="timeline-date">2011-2015年</div>
                                <h4 class="timeline-title">计算机科学与技术学士</h4>
                                <div class="timeline-subtitle">清华大学 · 北京</div>
                                <p class="timeline-description">
                                    主修计算机科学，专注于软件工程和Web技术方向。
                                    在校期间参与多个开源项目，获得校级优秀毕业生荣誉。
                                </p>
                            </div>
                            <div class="timeline-item">
                                <div class="timeline-date">2015年</div>
                                <h4 class="timeline-title">全栈Web开发认证</h4>
                                <div class="timeline-subtitle">FreeCodeCamp</div>
                                <p class="timeline-description">
                                    完成包括前端开发、数据可视化、后端开发和API开发的全栈课程。
                                </p>
                            </div>
                        </div>
                    </section>
                </main>

                <aside class="sidebar">
                    <div class="sidebar-section about-me">
                        <img src="https://avatars.githubusercontent.com/u/583231?v=4" alt="Avatar" class="avatar">
                        <h3>关于作者</h3>
                        <p>全栈开发者，专注于现代Web技术。热爱开源，喜欢分享技术知识。</p>
                        <div class="social-links">
                            <a href="#"><i class="fab fa-github"></i></a>
                            <a href="#"><i class="fab fa-twitter"></i></a>
                            <a href="#"><i class="fab fa-linkedin"></i></a>
                            <a href="#"><i class="fas fa-envelope"></i></a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>技术专长</h3>
                        <div class="tags-list">
                            <a href="#">React</a>
                            <a href="#">Node.js</a>
                            <a href="#">TypeScript</a>
                            <a href="#">MongoDB</a>
                            <a href="#">Docker</a>
                            <a href="#">AWS</a>
                            <a href="#">Git</a>
                            <a href="#">REST API</a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>开源贡献</h3>
                        <div class="tags-list">
                            <a href="#">React</a>
                            <a href="#">Vue.js</a>
                            <a href="#">Webpack</a>
                            <a href="#">Babel</a>
                            <a href="#">ESLint</a>
                        </div>
                    </div>

                    <div class="sidebar-section">
                        <h3>联系我</h3>
                        <p>如有技术问题或合作机会，欢迎联系</p>
                        <div style="margin-top: 12px; display: flex; flex-direction: column; gap: 8px;">
                            <div style="display: flex; align-items: center; gap: 8px;">
                                <i class="fas fa-envelope" style="color: var(--accent-color);"></i>
                                <span>contact@techblog.dev</span>
                            </div>
                            <div style="display: flex; align-items: center; gap: 8px;">
                                <i class="fas fa-phone" style="color: var(--accent-color);"></i>
                                <span>+86 138-XXXX-XXXX</span>
                            </div>
                            <div style="display: flex; align-items: center; gap: 8px;">
                                <i class="fas fa-map-marker-alt" style="color: var(--accent-color);"></i>
                                <span>中国，上海</span>
                            </div>
                        </div>
                    </div>
                </aside>
            </div>
        </div>
    </div>

    <footer>
        <div class="container">
            <p>© 2023 TechBlog. 保留所有权利。</p>
            <p>采用 Github 风格设计 | 由开发者为开发者打造</p>
        </div>
    </footer>

    <script>
        // 主题切换功能
        const themeToggle = document.getElementById('themeToggle');
        const themeIcon = themeToggle.querySelector('i');
        const themeText = themeToggle.querySelector('span');

        // 检查本地存储的主题偏好
        const currentTheme = localStorage.getItem('theme') || 'light';
        if (currentTheme === 'dark') {
            document.body.classList.add('dark-theme');
            themeIcon.classList.remove('fa-moon');
            themeIcon.classList.add('fa-sun');
            themeText.textContent = '浅色模式';
        }

        themeToggle.addEventListener('click', () => {
            document.body.classList.toggle('dark-theme');

            if (document.body.classList.contains('dark-theme')) {
                themeIcon.classList.remove('fa-moon');
                themeIcon.classList.add('fa-sun');
                themeText.textContent = '浅色模式';
                localStorage.setItem('theme', 'dark');
            } else {
                themeIcon.classList.remove('fa-sun');
                themeIcon.classList.add('fa-moon');
                themeText.textContent = '深色模式';
                localStorage.setItem('theme', 'light');
            }
        });

        // 移动端菜单切换
        const mobileMenu = document.getElementById('mobileMenu');
        const navLinks = document.querySelector('.nav-links');
        const menuIcon = mobileMenu.querySelector('i');

        mobileMenu.addEventListener('click', () => {
            navLinks.classList.toggle('active');

            if (navLinks.classList.contains('active')) {
                menuIcon.classList.remove('fa-bars');
                menuIcon.classList.add('fa-times');
            } else {
                menuIcon.classList.remove('fa-times');
                menuIcon.classList.add('fa-bars');
            }
        });

        // 点击菜单外区域关闭菜单
        document.addEventListener('click', (e) => {
            if (!e.target.closest('.navbar') && navLinks.classList.contains('active')) {
                navLinks.classList.remove('active');
                menuIcon.classList.remove('fa-times');
                menuIcon.classList.add('fa-bars');
            }
        });

        // 窗口大小变化时调整菜单状态
        window.addEventListener('resize', () => {
            if (window.innerWidth > 768) {
                navLinks.classList.remove('active');
                menuIcon.classList.remove('fa-times');
                menuIcon.classList.add('fa-bars');
            }
        });

        // 技能条动画效果
        document.addEventListener('DOMContentLoaded', () => {
            const skillBars = document.querySelectorAll('.skill-progress');

            // 创建观察器来检测技能条是否进入视口
            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        const width = entry.target.style.width;
                        entry.target.style.width = '0%';

                        // 延迟执行动画，确保过渡效果可见
                        setTimeout(() => {
                            entry.target.style.width = width;
                        }, 100);

                        observer.unobserve(entry.target);
                    }
                });
            }, { threshold: 0.5 });

            skillBars.forEach(bar => {
                observer.observe(bar);
            });
        });
    </script>
</body>

</html>